<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>MoneyLee’s Blog - 个人博客</title><meta name="author" content="李财"><meta name="copyright" content="李财"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="开发者">
<meta property="og:type" content="website">
<meta property="og:title" content="MoneyLee’s Blog">
<meta property="og:url" content="https://moneylee.gitee.io/myblog/page/4/index.html">
<meta property="og:site_name" content="MoneyLee’s Blog">
<meta property="og:description" content="开发者">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:author" content="李财">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/myblog/img/favicon.png"><link rel="canonical" href="https://moneylee.gitee.io/myblog/page/4/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/myblog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/myblog/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'MoneyLee’s Blog',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-02-21 16:43:45'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.0.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">46</div></a></div><div class="data-item"><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a></div><div class="data-item"><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">10</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 影音</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/myblog/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/myblog/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/myblog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://i.loli.net/2019/05/22/5ce53eb6dc82757840.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/myblog/">MoneyLee’s Blog</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 影音</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/myblog/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/myblog/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/myblog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">MoneyLee’s Blog</h1><div id="site_social_icons"><a class="social-icon" href="https://gitee.com/moneylee" target="_blank" title="Gitee"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:licai_1024@hotmail.com" target="_blank" title=""><i class="fas fa-envelope"></i></a><a class="social-icon" href="/myblog/img/mywechat.jpg" target="_blank" title=""><i class="fab fa-weixin"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/myblog/2019/12/10/Linux%E7%8E%AF%E5%A2%83%E4%B8%8BMysql%E6%95%B0%E6%8D%AE%E5%BA%93%E8%87%AA%E5%8A%A8%E5%A4%87%E4%BB%BD%E8%84%9A%E6%9C%AC/" title="Linux环境下Mysql数据库自动备份脚本"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl6v5kt7j31g60squ0y.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Linux环境下Mysql数据库自动备份脚本"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/12/10/Linux%E7%8E%AF%E5%A2%83%E4%B8%8BMysql%E6%95%B0%E6%8D%AE%E5%BA%93%E8%87%AA%E5%8A%A8%E5%A4%87%E4%BB%BD%E8%84%9A%E6%9C%AC/" title="Linux环境下Mysql数据库自动备份脚本">Linux环境下Mysql数据库自动备份脚本</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-12-10T09:12:02.000Z" title="发表于 2019-12-10 17:12:02">2019-12-10</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span></div><div class="content">准备工作创建好备份使用的文件夹存放最新备份文件的文件夹：
mkdir /mnt/backup/bakmysql
存放历史备份的文件夹：
mkdir /mnt/backup/backmysqlold
编辑脚本1234567891011121314151617181920212223242526272829303132#用户名db_user=&quot;root&quot;#密码db_passwd=&quot;123456&quot;#数据库名db_name=&quot;lc_data&quot;#指定数据库安装路径 可以让crontab找到执行文件 如果直接写mysqldump仅在本地执行脚本好使 crontab执行是空文件tool=&quot;/usr/local/mysql5.7/bin/mysqldump&quot;#进入备份目录将之前的移动到old目录cd /mnt/backup/bakmysqlecho &quot;you are in bakmysql directory now&quot;#将当前备份的数据移动到旧文件夹内mv lc_data* /mnt/backup/ba ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/myblog/2019/12/10/%E6%95%B0%E6%8D%AE%E5%BA%93/" title="数据库常见问题汇总"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl6v5kt7j31g60squ0y.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="数据库常见问题汇总"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/12/10/%E6%95%B0%E6%8D%AE%E5%BA%93/" title="数据库常见问题汇总">数据库常见问题汇总</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-12-10T09:12:02.000Z" title="发表于 2019-12-10 17:12:02">2019-12-10</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span></div><div class="content">1153 - Got a packet bigger than ‘max_allowed_packet’ bytes数据库数据同步导入时,文件过大导致出现此错误, 注意: 此种方式不用重启sql服务,只是临时修改.
1234567891011121314mysql&gt; show VARIABLES like &#x27;%max_allowed_packet%&#x27;;+--------------------------+-------+| Variable_name            | Value |+--------------------------+-------+| max_allowed_packet       | 2048  || slave_max_allowed_packet | 2048  |+--------------------------+-------+2 rows in set (0.00 sec)mysql&gt; set global net_buffer_length=1000000;Query OK, 0 rows affect ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/myblog/2019/11/09/Windows%20Server%202012%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%80%E6%AC%A1%E4%BD%BF%E7%94%A8%E8%AE%B0%E5%BD%95/" title="Windows Server 2012 使用记录"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vkhjxkcwj31do0u0npe.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Windows Server 2012 使用记录"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/11/09/Windows%20Server%202012%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%80%E6%AC%A1%E4%BD%BF%E7%94%A8%E8%AE%B0%E5%BD%95/" title="Windows Server 2012 使用记录">Windows Server 2012 使用记录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-11-09T09:12:02.000Z" title="发表于 2019-11-09 17:12:02">2019-11-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/%E9%9A%8F%E7%AC%94/">随笔</a></span></div><div class="content">前段时间接到一个为公司客户开发官网的任务, 框架使用Jeesite, 前后端分离项目, 数据库是Mysql5.7。接下来就记录下遭遇的一切。
大约三天开发完后台服务及管理界面的配置, 配合前台接口调试用了一天, 然后客户购买的阿里云服务器, 我原以为是Linux服务器, 所以也没多问就按照之前的习惯, 用Mac的ssh直接连接, 提示 22端口访问被拒绝, 什么鬼? 22端口没开, 然后几经辗转要到阿里云账号并登录到管理后台, 重置了实例密码(因为客户也不知道密码是啥), 说实在的, 我连Windows电脑都好些年不用了, 所有的命令行也不怎么会, 这可难到我了,  研究了好一阵子, 我才知道windows有自己的远程连接工具, 并且需要开放的端口是 3389, 然后阿里云后台配置网络安全组, 开放 80, 3389 , 3306 入规则访问权限, 分别是网路请求, 远程控制 和 数据库, 方便我以后的开发调试工作, 等真正交付的时候再关闭掉 3389和3306,  然后用Tomcat开始部署, 其实使用这一个服务就可以了, 但是个人习惯还是兼顾使用了 Nginx服务, 然后 下载Ja ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/myblog/2019/11/09/%E5%BC%80%E7%AF%87/" title="开篇"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vkhjxkcwj31do0u0npe.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="开篇"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/11/09/%E5%BC%80%E7%AF%87/" title="开篇">开篇</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-11-09T09:12:02.000Z" title="发表于 2019-11-09 17:12:02">2019-11-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/%E9%9A%8F%E7%AC%94/">随笔</a></span></div><div class="content">原本想使用 spring-boot + vue 开发一款博客系统, 但是平时也没有多少时间, 做出来的样式也不是很喜欢。今天无意间发现Hexo这个开源的博客框架, 决定拿来试一试, 效果还不错, 今后会继续完善下去, 我也会将 简书、掘金的一些之前写作的文章导入进来, 希望通过它能让我养成技术文档整理归纳的好习惯, 我也会在此更新一些生活上的故事和心得体悟。</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/myblog/2019/11/09/%E8%AE%B0%E5%BD%95%E4%B8%80%E6%AC%A1%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%B0%83%E7%94%A8Echarts/" title="记录一次微信小程序调用Eharts"><img class="post_bg" src="" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="记录一次微信小程序调用Eharts"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/11/09/%E8%AE%B0%E5%BD%95%E4%B8%80%E6%AC%A1%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%B0%83%E7%94%A8Echarts/" title="记录一次微信小程序调用Eharts">记录一次微信小程序调用Eharts</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-11-09T09:12:02.000Z" title="发表于 2019-11-09 17:12:02">2019-11-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F/">微信小程序</a></span></div><div class="content">记录一次微信小程序调用Eharts(柱状图)Echarts 微信小程序版本地址: 
可以参考其使用文档进行操作, 写的比较详细了.
下面说下我的操作方式及遇到的一些问题:
下载github上的项目到本地, 然后拷贝项目内的ec-canvas文件至我的项目内, 因为我的项目是用npm导包, 所以我为了统一, 拷贝至了根目录下的node_modules目录下. 其实直接放根目录就行了

小程序新建一个页面用来展示报表

在 dataShow.json 内添加引用的组件 供wxml内使用
12345&#123;  &quot;usingComponents&quot;: &#123;    &quot;ec-canvas&quot;: &quot;../../miniprogram_npm/ec-canvas/ec-canvas&quot;  &#125;&#125;
在 dataShow.js 内引用echarts  并定义个全局变量 chatimport * as echarts from &#39;../../miniprogram_npm/ec-canvas/echarts&#39; ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/myblog/2019/10/06/SpringBoot%20%E5%AE%9A%E6%97%B6%E4%BB%BB%E5%8A%A1%E5%86%85%20%E4%BD%BF%E7%94%A8@Autowired%E6%B3%A8%E5%85%A5Service%20%E8%8E%B7%E5%8F%96%E4%B8%8D%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98/" title="SpringBoot 定时任务内 使用@Autowired注入Service 获取不到的问题"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="SpringBoot 定时任务内 使用@Autowired注入Service 获取不到的问题"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/10/06/SpringBoot%20%E5%AE%9A%E6%97%B6%E4%BB%BB%E5%8A%A1%E5%86%85%20%E4%BD%BF%E7%94%A8@Autowired%E6%B3%A8%E5%85%A5Service%20%E8%8E%B7%E5%8F%96%E4%B8%8D%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98/" title="SpringBoot 定时任务内 使用@Autowired注入Service 获取不到的问题">SpringBoot 定时任务内 使用@Autowired注入Service 获取不到的问题</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-10-06T02:12:02.000Z" title="发表于 2019-10-06 10:12:02">2019-10-06</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/Java/">Java</a></span></div><div class="content">近段时间使用微信Web版的API,实现一个微信机器人, 想每天早上像微信群发送天气预报, 在创建定时任务的时候,发现抛出异常,断点发现是在定时任务里获取不到ChatroomDescriptionService 这个service, 在网上查了查,发现需要手动去配置一个类，主动获取实例来解决这个问题。
首先创建一个工具类:
12345678910111213141516171819202122232425262728293031323334353637package com.cherry.jeeves.utils;import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextAware;import org.springframework.stereotype.Component;/** * @className: ApplicationCon ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/myblog/2019/08/16/Docker%20%E9%83%A8%E7%BD%B2Nginx%20%E5%B9%B6%E4%B8%94%E6%8C%82%E8%BD%BD%E9%BB%98%E8%AE%A4%E8%AF%B7%E6%B1%82%E8%B7%AF%E5%BE%84%E5%92%8C%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/" title="Docker 部署Nginx 并且挂载默认请求路径和配置文件"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Docker 部署Nginx 并且挂载默认请求路径和配置文件"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/08/16/Docker%20%E9%83%A8%E7%BD%B2Nginx%20%E5%B9%B6%E4%B8%94%E6%8C%82%E8%BD%BD%E9%BB%98%E8%AE%A4%E8%AF%B7%E6%B1%82%E8%B7%AF%E5%BE%84%E5%92%8C%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6/" title="Docker 部署Nginx 并且挂载默认请求路径和配置文件">Docker 部署Nginx 并且挂载默认请求路径和配置文件</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-08-16T05:12:02.000Z" title="发表于 2019-08-16 13:12:02">2019-08-16</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/Docker/">Docker</a></span></div><div class="content">首先进入宿主机终端命令行 启动docker
service docker start
查看已安装docker镜像列表
docker images

如果没有安装就安装下
docker pull nginx
然后得启动这个镜像 正常启动是下面的命令,但是先别着急敲
docker run -d -p 80:80 nginx
简单解释下这里面的值都代表啥意思 -d是让这个nginx容器服务后台运行 -p是指定端口 后面跟的80:80 前面的80是宿主机的端口 后面的是容器里nginx的端口, 比如改成 8080:80 那么我们在外部访问这个nginx服务 地址应该是 xx.xx.xx.xx:8080 就可以看到nginx的欢迎页了
nginx当然是启动的镜像名字啦
但是啊,这么写不好,如果你像改这个nginx的配置文件,或者改个静态页咋改啊,我们得到这个容器的内部去改啊, 简单说下如何进入这个容器的内部
先获取到这个nginx容器的id , 查询所有容器 无论是运行的还是exit的,其实在不在执行你都能看出来了,因为上面有exit标识着呢
docker ps -a

你看,映射的端口号都给你 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/myblog/2019/08/10/U%E7%9B%98%E5%AE%89%E8%A3%85CentOS7.4/" title="U盘安装CentOS 7.4"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl6v5kt7j31g60squ0y.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="U盘安装CentOS 7.4"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/08/10/U%E7%9B%98%E5%AE%89%E8%A3%85CentOS7.4/" title="U盘安装CentOS 7.4">U盘安装CentOS 7.4</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-08-10T07:12:02.000Z" title="发表于 2019-08-10 15:12:02">2019-08-10</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/%E8%BF%90%E7%BB%B4/">运维</a></span></div><div class="content">U盘安装CentOS 7.4安装准备1、8G以上U盘 （U盘需要格式化 数据提前备份好）
2、安装最新版UltraISO(软碟通)  下载地址
3、下载CentOS镜像iso文件（我下载安装的是64位的）
​      推荐去阿里云下载：下载地址
​             

我下载的是种子文件 最终用迅雷下载镜像






制作安装盘1、用软碟通打开镜像文件： 文件–&gt;打开

2、写入映像：启动–&gt;写入硬盘映像

点击写入，写入完成后，建议右键U盘的盘符  重命名为 CENTOS
系统安装重启电脑，进入BIOS界面选择U盘启动  至于如何进入BIOS系统因为主板厂商不一样会有差异，可以自行查找或者F2 F12都试试。
切换到USB HDD 然后回车

下图位置切换到 Install CentOS Linux 7  注意一定不要回车， 按E键 进入编辑 指定U盘安装路径


将 
123setparams &#x27;Install CentOS Linux 7&#x27;linuxefi/images/pxeboot/vmlinuz inst.stage2=hd:LA ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/myblog/2019/06/10/%E6%90%AD%E5%BB%BAGitLab%E6%9C%8D%E5%8A%A1%E5%99%A8/" title="搭建GitLab服务器 及 GitLab-CI服务"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl6v5kt7j31g60squ0y.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="搭建GitLab服务器 及 GitLab-CI服务"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/06/10/%E6%90%AD%E5%BB%BAGitLab%E6%9C%8D%E5%8A%A1%E5%99%A8/" title="搭建GitLab服务器 及 GitLab-CI服务">搭建GitLab服务器 及 GitLab-CI服务</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-06-10T12:12:02.000Z" title="发表于 2019-06-10 20:12:02">2019-06-10</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/%E8%BF%90%E7%BB%B4/">运维</a></span></div><div class="content">GitLab Server 的搭建参考 https://about.gitlab.com/installation
1. 准备工作以Centos7为例，准备一台至少内存为4G的机器。
2. 安装依赖软件12345678sudo yum install -y git vim gcc glibc-static telnetsudo yum install -y curl policycoreutils-python openssh-serversudo systemctl enable sshdsudo systemctl start sshdsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfix


3. 设置gitlab安装源如果在国内的话，可以尝试使用清华大学的源。
新建 /etc/yum.repos.d/gitlab-ce.repo，内容为
12345[gitlab-ce]name=Gitlab CE Repositorybaseurl=https://mirrors.tun ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/myblog/2019/06/10/Windows%20Server%202012%20Nginx/" title="Windows Server 2012 安装 Nginx"><img class="post_bg" src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl6v5kt7j31g60squ0y.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Windows Server 2012 安装 Nginx"></a></div><div class="recent-post-info"><a class="article-title" href="/myblog/2019/06/10/Windows%20Server%202012%20Nginx/" title="Windows Server 2012 安装 Nginx">Windows Server 2012 安装 Nginx</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-06-10T08:10:31.000Z" title="发表于 2019-06-10 16:10:31">2019-06-10</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/myblog/categories/%E8%BF%90%E7%BB%B4/">运维</a></span></div><div class="content">下载Nginx下载地址：http://nginx.org/download/
创建安装目录： C:\Program Files\Nginx
解压至此目录下
将Nginx设置为windows服务下载 Windows Service Wrapper 工具 项目地址: 地址
下载地址：地址
下载该工具后，将其放在 Nginx安装目录下，并重命名为nginx-service.exe，创建配置文件nginx-service.xml（名字要和工具名一样），
创建nginx-service.exe.config（为支持NET 4.0 runtime，默认只支持NET 2.0 runtime）
文件夹结构如下：

nginx-service.xml 内容如下：
1234567891011121314&lt;service&gt;  &lt;id&gt;nginx&lt;/id&gt;  &lt;name&gt;Nginx Service&lt;/name&gt;  &lt;description&gt;High Performance Nginx Service&lt;/description&gt; ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/myblog/page/3/#content-inner"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/myblog/">1</a><span class="space">&hellip;</span><a class="page-number" href="/myblog/page/3/#content-inner">3</a><span class="page-number current">4</span><a class="page-number" href="/myblog/page/5/#content-inner">5</a><a class="extend next" rel="next" href="/myblog/page/5/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/myblog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">李财</div><div class="author-info__description">开发者</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">46</div></a></div><div class="card-info-data-item"><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">0</div></a></div><div class="card-info-data-item"><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">10</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://gitee.com/moneylee" target="_blank" title="Gitee"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:licai_1024@hotmail.com" target="_blank" title=""><i class="fas fa-envelope"></i></a><a class="social-icon" href="/myblog/img/mywechat.jpg" target="_blank" title=""><i class="fab fa-weixin"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/myblog/2021/08/14/Flutter%E5%8F%91%E5%B8%83%E4%BB%A3%E7%A0%81%E5%88%B0%E4%BB%93%E5%BA%93/" title="Flutter发布代码到PUB仓库"><img src="http://file.moneylee.top/uPic/flutter.png" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Flutter发布代码到PUB仓库"/></a><div class="content"><a class="title" href="/myblog/2021/08/14/Flutter%E5%8F%91%E5%B8%83%E4%BB%A3%E7%A0%81%E5%88%B0%E4%BB%93%E5%BA%93/" title="Flutter发布代码到PUB仓库">Flutter发布代码到PUB仓库</a><time datetime="2021-08-14T12:04:03.000Z" title="发表于 2021-08-14 20:04:03">2021-08-14</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/21/iOS%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" title="iOS机器学习"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="iOS机器学习"/></a><div class="content"><a class="title" href="/myblog/2020/08/21/iOS%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" title="iOS机器学习">iOS机器学习</a><time datetime="2020-08-21T02:04:10.000Z" title="发表于 2020-08-21 10:04:10">2020-08-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/20/Docker%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86/" title="Docker 基础知识整理"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl4zhjzuj30qy0e0gyz.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Docker 基础知识整理"/></a><div class="content"><a class="title" href="/myblog/2020/08/20/Docker%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86/" title="Docker 基础知识整理">Docker 基础知识整理</a><time datetime="2020-08-20T12:12:02.000Z" title="发表于 2020-08-20 20:12:02">2020-08-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/19/Flutter/" title="Flutter"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="Flutter"/></a><div class="content"><a class="title" href="/myblog/2020/08/19/Flutter/" title="Flutter">Flutter</a><time datetime="2020-08-19T02:04:03.000Z" title="发表于 2020-08-19 10:04:03">2020-08-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/myblog/2020/08/19/iOS%20AR%E5%92%8CARKit4/" title="iOS AR和ARKit4"><img src="https://tva1.sinaimg.cn/large/006y8mN6ly1g8vl0019wlj31ej0u0x6q.jpg" onerror="this.onerror=null;this.src='/myblog/img/404.jpg'" alt="iOS AR和ARKit4"/></a><div class="content"><a class="title" href="/myblog/2020/08/19/iOS%20AR%E5%92%8CARKit4/" title="iOS AR和ARKit4">iOS AR和ARKit4</a><time datetime="2020-08-19T02:04:03.000Z" title="发表于 2020-08-19 10:04:03">2020-08-19</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            <a class="card-more-btn" href="/myblog/categories/" title="查看更多">
    <i class="fas fa-angle-right"></i></a>
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/myblog/categories/Docker/"><span class="card-category-list-name">Docker</span><span class="card-category-list-count">4</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/myblog/categories/Flutter/"><span class="card-category-list-name">Flutter</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/myblog/categories/Java/"><span class="card-category-list-name">Java</span><span class="card-category-list-count">10</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/myblog/categories/Linux/"><span class="card-category-list-name">Linux</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/myblog/categories/iOS/"><span class="card-category-list-name">iOS</span><span class="card-category-list-count">10</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/myblog/categories/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/"><span class="card-category-list-name">人工智能</span><span class="card-category-list-count">7</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/myblog/categories/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F/"><span class="card-category-list-name">微信小程序</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/myblog/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/"><span class="card-category-list-name">数据库</span><span class="card-category-list-count">3</span></a></li>
            </ul></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/myblog/archives/" title="查看更多">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/myblog/archives/2021/08/"><span class="card-archive-list-date">八月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/myblog/archives/2020/08/"><span class="card-archive-list-date">八月 2020</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/myblog/archives/2020/07/"><span class="card-archive-list-date">七月 2020</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/myblog/archives/2020/06/"><span class="card-archive-list-date">六月 2020</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/myblog/archives/2020/05/"><span class="card-archive-list-date">五月 2020</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/myblog/archives/2020/02/"><span class="card-archive-list-date">二月 2020</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/myblog/archives/2019/12/"><span class="card-archive-list-date">十二月 2019</span><span class="card-archive-list-count">3</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/myblog/archives/2019/11/"><span class="card-archive-list-date">十一月 2019</span><span class="card-archive-list-count">3</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">46</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-02-21T08:43:45.001Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 李财</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/myblog/js/utils.js"></script><script src="/myblog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>